# node版本： 16.19.1  node:16.9.1-alpine3.14  16.19.1-alpine3.16 node:18.12.0-alpine3.16
FROM docker.m.daocloud.io/node:18.12.0-alpine3.16
MAINTAINER liuchuang@csc-sz.cn

# 替换官方软件源为阿里的
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
    # 将npm设置为淘宝镜像
    npm config set registry registry=https://registry.npmmirror.com && \
    npm install -g cnpm --registry=https://registry.npmmirror.com && \
    apk update && apk add git maven docker && \
    apk add --no-cache vim openssl openssh openssl-dev bash curl libevent &&\
    # Time Zone Database，简称tz或tzinfo，是一组表示地球上各地的时间历史的代码和数据
    apk add -U tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&  apk del tzdata

# 将私服10.28.25.211:8082的登录认证添加到镜像
COPY config.json /root/.docker/

# 登录npm私服的凭据 npm adduser --registry=http://10.28.25.211:8081/repository/npm-public/
COPY .npmrc /root/